package com.shawn.example.mvvmdemo.home.ui.wx

import com.shawn.example.mvvmdemo.home.vo.FeedArticleData
import com.chad.library.adapter.base.BaseQuickAdapter
import com.shawn.example.mvvmdemo.home.ui.wx.viewholder.KnowledgeHierarchyListViewHolder

class ArticleListAdapter(layoutResId: Int, data: MutableList<FeedArticleData>?) :
    BaseQuickAdapter<FeedArticleData, KnowledgeHierarchyListViewHolder>(layoutResId, data) {
    var isCollectPage = false
        private set
        get() {
            field = true
            notifyDataSetChanged()
            return field
        }

    var isSearchPage = false
        private set
        get() {
            field = true
            notifyDataSetChanged()
            return field
        }

    private var isNightMode = false
    private val mHasRecorded = false
    fun isNightMode(isNightMode: Boolean) {
        this.isNightMode = isNightMode
        notifyDataSetChanged()
    }

    override fun convert(helper: KnowledgeHierarchyListViewHolder, article: FeedArticleData) {
        helper.buildLayout(article!!)
    }
}